1. Field of the Invention
The present invention relates to a contour-information extracting method by use of image processing on an image to be searched, a pattern model creating method in image processing, a pattern model positioning method in image processing, an image processing apparatus, an image processing program, and a computer readable recording medium, upon positioning by searching an object to be searched that is similar to a pre-registered image out of an image to be searched by use of a pattern model corresponding to the registered image.
2. Description of the Related Art
An image processing apparatus for processing an image picked up by an image pickup element typically includes: an image pickup apparatus for picking up an image processing object (hereinafter also referred to as “work”); an image data storing device for storing data on the image picked up by the image pickup apparatus; and an image data processing device for processing the image data stored by the image data storing device. For example, in the image processing apparatus in which the image pickup apparatus is made up of a CCD camera, luminance data (so-called multi-valued data) such as 256 levels of gray or 1024 levels of gray is obtained based on each of charge amounts of a large number of charge coupled elements constituting an image pickup surface, whereby a position, a rotational angle and the like of the work as an object to be searched can be found. Conventionally, as techniques for performing processing on image data to search an object to be searched in image processing, there are known a difference search performed using a total value of absolute values of pixel difference values between images, a normalized correlation search performed using normalized correlation values between images, and the like. In these searches, an object to be searched that is wished to be searched is previously registered as a template image, and based on the image, a search is executed for the object to be searched out of an image to be searched. In these search processing, a region-based search by use of image data has conventionally been mainstream. However, such a conventional region-based search based on image thickness or the like has the problem of being susceptible to a change in illumination upon image pickup, and the like.
Meanwhile, there has also been provided a method for performing edge extraction processing on a registered image and an image to be searched, to perform a search based on edge information. In this method, a concentration value of pixels constituting image data is not used, but edge data based on an amount of change in concentration value is used, and hence it is possible to obtain the advantage of being not susceptible to fluctuations in illumination upon image pickup. Especially, in recent years, an edge-based pattern search with an edge regarded as a characteristic amount is drawing attention for its high robustness, and is in practical use in industrial applications and the like.
As a technique for improving a processing speed of a pattern search, a “coarse to fine” approach is known. Namely, first, a search is coarsely performed using a low-resolution image (coarse image), and after a rough position is specified, detailed positioning is performed using a high-resolution image (fine image), thereby to enhance accuracy of a position and posture. In the case of performing the edge-based search by means of coarse-to-fine type template matching, a pyramid search is used where a search is performed using coarse data obtained by compressing (also referred to as “thinning out” or the like) original data, to specify a rough position, and thereafter, a search is performed using detailed data. FIG. 87 shows a concept of the pyramid search. As shown in this drawing, a rough search (referred to as “coarse search” or the like) is performed using a low-resolution image having a high reduction ratio, to find a rough position. Thereafter, a search is performed in the vicinity thereof with an increased resolution and an intermediate reduction ratio, and finally, a fine search is performed on an image of an original size or an image having a reduction ratio close to the original size. As thus described, in the typical pyramid search, a plurality of images having changed resolutions are prepared, and a schematic position is first detected by use of an image having the lowest resolution. In subsequent processing, a search range is narrowed down to the vicinity of the previous detected position as the resolution is gradually increased. Thereby, the accuracy of the detected position enhances with each succeeding processing level, finally leading to detection of a highly accurate position with the resolution being that of the original image or closer thereto. As a technique concerning fine positioning for finding a position and posture with high accuracy by means of such coarse-to-fine type template matching, an image processing apparatus of Japanese Patent No. 3759983 is known.
In the coarse-to-fine type template matching as described above, contour information, such as chains created by coupling edge points extracted from the image and segments created by approximating the chains by a line or a circular arc, are used. Then, pattern matching is performed using a long contour portion among the obtained contours. This is because, since the extracted edge points also include noise, attaching importance to a long line considered to have noise eliminated so as to obtain a stable contour can lead to improvement in detection accuracy.
However, it was found from a test made by the present applicant that, when a pattern search is performed by use of a long line, there are cases, depending upon an object to be searched, where identification takes long or a search result indicates an error. For example considered is the case of setting a rectangular pattern window PW as a region for creating a pattern model with respect to an object image where characters are displayed in frames as shown in FIG. 67. In this case, since the frames are common and the characters inside the frames change, it is necessary to perform identification by attaching importance to the characters inside the frames. Nevertheless, in the conventional method, since a contour obtained from this portion is relatively short whereas a relatively long contour is extracted from an outer frame portion surrounding the characters, as a result of performing the pattern search in the frame portion, identifying the character portions becomes difficult, bringing about displacement of the detection position in units of frames.